from typing import Final

#Final 将类或者变量设置为常量 不可变
#@Final

def newPerson(name,age,address):
    Person(name,age,address)


class Person:
    __name = ""
    __age  = 0
    __address = ""
    def __init__(self,name,age,address):
        self.__name=name
        self.age=age
        self.__address=address

    # def getName(self,name):
    #     self.__name=name
    # def setName(self,name):

    def display(self):
        print(f"名字是: {self.__name}, 年龄是: {self.age}, 地址是: {self.__address}")

class Student(Person):
    school = ""
    courseList = []
    gpa = 0
    def __init__(self,name,age,address,school,courseList,gpa):
        Person.__init__(self,name,age,address)
        self.school=school
        self.courseList=courseList
        self.gpa=gpa
    def display(self):
        print(f"名字是: {self.__name}, 年龄是: {self.age}, 地址是: {self.__address}")
        print(f"学校是: {self.school}, 课程有: {self.courseList}, 学分是: {self.gpa}")

class teacher(Person):
    school = ""
    title = ""
    def __init__(self,name,age,address,school,title):
        Person.__init__(self,name,age,address)
        self.school=school
        self.title=title
    def display(self):
        print(f"名字是: {self.__name}, 年龄是: {self.age}, 地址是: {self.__address}")
        print(f"学校是: {self.school}, 职称: {self.title}")

class Tutor(Student,teacher):
    sSchool = ""
    eSchool = ""

    def __init__(self,name,age,address,sSchool,eSchool,title,courseList,gpa):
        Student.__init__(self,name,age,address,sSchool,courseList,gpa)
        self.eSchool = eSchool
        self.title = title
    def display(self):
        print("作为学生的信息如下: ")
        Student.display(self)
        print("作为老师的信息如下: ")
        teacher.display(self)





if __name__ == '__main__':
    std1 = Student("yzy",18,"www","清华",["英语","语文"],10)
    tea1 = teacher("yyy",100,"http","北大","老师")
    Tut = Tutor("zzz",36,"https","清华","北大","助教",["英语","语文"],40)

    std1.display()
    print("==============================================")
    tea1.display()
    print("===========================================")

    Tut.display()


